﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EFITransmissao
{
    public partial class FrmRoteiroGeral : Form
    {
        public FrmRoteiroGeral()
        {
            InitializeComponent();
        }

        private void FrmRoteiroGeral_Load(object sender, EventArgs e)
        {
            cbLeituristas.DataSource = Interface.InterTransmissao.ObterListaLeituristasRoteiroGeral();
            DataTable dt = Controle.CtlLeitura.ObterTodosControle();

            foreach (DataRow dr in dt.Rows)
            {
                dGrid.DataSource = Interface.InterTransmissao.ObterLeituristasRoteiroGeral_Nome(int.Parse(dr["Matricula"].ToString()));
            }            
        }

        private void cbLeituristas_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbLeituristas.Text == string.Empty)
                return;

            dGrid.DataSource = Interface.InterTransmissao.ObterLeituristasRoteiroGeral_Nome(int.Parse(Controle.CtlLeiturista.ObterMatriculaCE(cbLeituristas.Text)));

        }

        private void mnFechar_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}